<template>
  <div>
    <div>组件生命周期</div>

  </div>
</template>
<script>
import { onBeforeMount, onMounted } from 'vue'
export default {
  name: 'App',
  setup () {
    // 挂载前触发
    onBeforeMount(() => {
      console.log('onBeforeMount')
    })
    // 挂载成功后触发
    onMounted(() => {
      console.log('mounted')
    })
    // 同样的生命周期函数可以触发多次
    onMounted(() => {
      console.log('mounted----')
    })
  }
}
</script>
